package com.zhaoxi.project.mes.service.impl;

import java.util.List;
import com.zhaoxi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhaoxi.project.mes.mapper.MesBomProcessMapper;
import com.zhaoxi.project.mes.domain.MesBomProcess;

/**
 * 物品工序清单Service业务层处理
 * 
 * @author zhaoxi
 * @date 2023-08-28
 */
@Service
public class MesBomProcessServiceImpl
{
    @Autowired
    private MesBomProcessMapper mesBomProcessMapper;

    /**
     * 查询物品工序清单
     * 
     * @param goodsCode 物品工序清单主键
     * @return 物品工序清单
     */
    
    public MesBomProcess selectMesBomProcessByGoodsCode(String goodsCode)
    {
        return mesBomProcessMapper.selectMesBomProcessByGoodsCode(goodsCode);
    }

    /**
     * 查询物品工序清单列表
     * 
     * @param mesBomProcess 物品工序清单
     * @return 物品工序清单
     */
    
    public List<MesBomProcess> selectMesBomProcessList(MesBomProcess mesBomProcess)
    {
        return mesBomProcessMapper.selectMesBomProcessList(mesBomProcess);
    }

    /**
     * 新增物品工序清单
     * 
     * @param mesBomProcess 物品工序清单
     * @return 结果
     */
    
    public int insertMesBomProcess(MesBomProcess mesBomProcess)
    {
        mesBomProcess.setCreateTime(DateUtils.getNowDate());
        return mesBomProcessMapper.insertMesBomProcess(mesBomProcess);
    }

    /**
     * 修改物品工序清单
     * 
     * @param mesBomProcess 物品工序清单
     * @return 结果
     */
    
    public int updateMesBomProcess(MesBomProcess mesBomProcess)
    {
        mesBomProcess.setUpdateTime(DateUtils.getNowDate());
        return mesBomProcessMapper.updateMesBomProcess(mesBomProcess);
    }

    /**
     * 批量删除物品工序清单
     * 
     * @param goodsCodes 需要删除的物品工序清单主键
     * @return 结果
     */
    
    public int deleteMesBomProcessByGoodsCodes(String[] goodsCodes)
    {
        return mesBomProcessMapper.deleteMesBomProcessByGoodsCodes(goodsCodes);
    }

    /**
     * 删除物品工序清单信息
     * 
     * @param goodsCode 物品工序清单主键
     * @return 结果
     */
    
    public int deleteMesBomProcessByGoodsCode(String goodsCode)
    {
        return mesBomProcessMapper.deleteMesBomProcessByGoodsCode(goodsCode);
    }
}
